/***********************************************************************************************************************
* Copyright (C) . All rights reserved.
***********************************************************************************************************************/

/***********************************************************************************************************************
* File Name    : main.c
* Version      :  
* Device(s)    : BAT32G137
* Tool-Chain   : MDK(armcc)
* Description  : This file is a template.
* Creation Date: 2019/4/30
***********************************************************************************************************************/

/***********************************************************************************************************************
Macro Definitions
***********************************************************************************************************************/

/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "BAT32G137.h"
#include "userdefine.h"
#include "clk.h"
#include "pcbz.h"

int main()
{
//-----------------------------------------------------------------------
// SubOSC enable 
//-----------------------------------------------------------------------
	//CLK_SubOsc_Setting(OSC_OSCILLATOR, OSC_ULTRA_LOW_POWER);	
	CLK_SubOsc_Setting(OSC_OSCILLATOR, OSC_LOW_POWER);
	//CLK_SubOsc_Setting(OSC_OSCILLATOR, OSC_NORMAL_POWER);		
	
//-----------------------------------------------------------------------
// PCLBUZ0 output 
//----------------------------------------------------------------------- 
	PCBZ_Init(PCBZ_CHANNEL_0, PCBZ_FMAIN_3);
//	CLKBUZ0_PORT_SETTING(); // P140/CLKBUZ0
//	PCBZ->CKS0  = 0x83;    	// FMAIN/2^3

//-----------------------------------------------------------------------
// PCLBUZ1 output 
//-----------------------------------------------------------------------
	PCBZ_Init(PCBZ_CHANNEL_1, PCBZ_FSUB_0);
//	CLKBUZ1_PORT_SETTING(); // P141/CLKBUZ1
//	PCBZ->CKS1  = 0x88;    	// FSUB
	
}

